package com.itheima.api.client.fallback;

import com.itheima.api.client.User.UserClient;
import com.itheima.api.client.UserDemoClient;
import com.itheima.api.client.dto.WebUser;
import com.itheima.api.client.entity.AdminUser;
import com.itheima.api.client.vo.BlogContributionVO;
import com.itheima.api.client.vo.ProvinceBLogNum;
import com.itheima.api.client.vo.TBlogByCategoryID;
import com.itheima.api.client.vo.TBlogByTagID;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.ArrayList;
import java.util.List;

@Slf4j
public class UserClientFallbackFactory implements FallbackFactory<UserDemoClient> {

    @Override
    public UserDemoClient create(Throwable cause) {
        log.error("调用blog-web服务异常：{}", cause.getMessage());
        return new UserDemoClient() {


            @Override
            public Long getBlogs() {
                return null;
            }

            @Override
            public Long getComments() {
                return null;
            }

            @Override
            public List<TBlogByTagID> getTBlogByTagID() {
                return null;
            }

            @Override
            public List<TBlogByCategoryID> getTBlogByCategoryID() {
                return null;
            }

            @Override
            public List<BlogContributionVO> getBlogContributions() {
                return null;
            }

            @Override
            public List<ProvinceBLogNum> getProvinceBLogNum(Integer classify) {
                return null;
            }

            @Override
            public List<Integer> queryWebUsersByName(String name) {
                return null;
            }

            @Override
            public List<WebUser> queryWebUsersByIds(List<Integer> userIds) {
                return null;
            }

            @Override
            public WebUser queryWebUserById(Long userId) {
                return null;
            }
        };
    }
}
